<?php
require_once ('../lib/config.php');
require_once ('../lib/facebook.php');
require_once ('../lib/friends.php');
require_once ('../lib/friend.php');
require_once ('../lib/test.php');
require_once ('f:\wamp\www\simpletest\autorun.php');
require_once ('../lib/init.php');

class TestTemplate extends UnitTestCase {
    
    function setUp(){
        global $login_button;
        $me = getOneself();
        if(!$me){
            print($login_button);
            exit();
        }
    }
    
    //refer to http://www.simpletest.org/en/unit_test_documentation.html
    function testCallGraphAPI(){ 
    
        $entry = "/me";
        $response = callGraphAPI($entry);

        print_r($response);
        
        $this->assertNotNull($response);
        $this->assertTrue(is_array($response));
        
        $entry = null;
        $response = callGraphAPI($entry);
        $this->assertNull($response);
        
        $entry = "";
        $response = callGraphAPI($entry);
        $this->assertNull($response);
        
//        $entry = "select 123";
//        try{
//            $response = callGraphAPI($entry);
//            $this->assertTrue(false);
//        }catch(Exception $e){
//            $this->assertTrue(true);
//        }
        

    }
}
?>